
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Tathata.Common.BLL.Entities;
using Tathata.Common.BLL.Managers;
using Tathata.Common.Utils;

namespace Tathata.Web.Administration
{
    public partial class Administration_CategoryTemplateAdd : BaseNopAdministrationPage
    {      
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void AddButton_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                try
                {
                    DateTime now = DateTime.Now;
                    CategoryTemplate categoryTemplate = CategoryTemplateManager.InsertCategoryTemplate(txtName.Text,
                        txtTemplatePath.Text, txtDisplayOrder.Value, now, now);

                    Response.Redirect("CategoryTemplateDetails.aspx?CategoryTemplateID=" + categoryTemplate.CategoryTemplateID.ToString());
                }
                catch (Exception exc)
                {
                    ProcessException(exc);
                }
            }
        }
    }
}
